<?php

class ProjectController extends Controller
{
	
   
   
   /**
    * 
    * Get all district by prv_id
   */
   public function actionSetDropListByDisID($dis_id){
      $option = array(0 => '-- Dự án --');
      if($dis_id > 0){
         $model = new Project();
         $object = $model->findAllByAttributes(array('prj_dis_id' => $dis_id));
         if(count($object) > 0){
            foreach($object as $item){
               $option[$item->attributes['prj_id']] = $item->attributes['prj_name'];
            }
         }
      }
      foreach($option as $key=>$value){
         echo '<option value="'.$key.'">'.$value.'</option>';
      }
   }

	// Uncomment the following methods and override them if needed
	/*
	public function filters()
	{
		// return the filter configuration for this controller, e.g.:
		return array(
			'inlineFilterName',
			array(
				'class'=>'path.to.FilterClass',
				'propertyName'=>'propertyValue',
			),
		);
	}

	public function actions()
	{
		// return external action classes, e.g.:
		return array(
			'action1'=>'path.to.ActionClass',
			'action2'=>array(
				'class'=>'path.to.AnotherActionClass',
				'propertyName'=>'propertyValue',
			),
		);
	}
	*/
}